Just a routine for niche bug fixes, linkage errors, perf improvements, etc.
"advapi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bufstream 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"crates-io 0.1.0",
- "crossbeam 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "curl 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "crossbeam 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
"docopt 0.6.78 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "filetime 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "flate2 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "filetime 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "flate2 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"git2-curl 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glob 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hamcrest 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "kernel32-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.48 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
- "semver 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "tar 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "semver 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tar 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "term 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
name = "crates-io"
version = "0.1.0"
dependencies = [
- "curl 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "crossbeam"
-version = "0.1.6"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "curl"
-version = "0.2.14"
+version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "curl-sys 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "curl-sys"
-version = "0.1.29"
+version = "0.1.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.6.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "regex 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.48 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.48 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "filetime"
-version = "0.1.8"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "flate2"
-version = "0.2.11"
+version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"miniz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "git2"
-version = "0.3.3"
+version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "curl 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "num 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "kernel32-sys"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "libc"
-version = "0.2.4"
+version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libgit2-sys"
-version = "0.3.8"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cmake 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libssh2-sys 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cmake 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "log"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
+[[package]]
+name = "nom"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
[[package]]
name = "num"
-version = "0.1.29"
+version = "0.1.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl-sys"
-version = "0.7.4"
+version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"user32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"advapi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex"
-version = "0.1.44"
+version = "0.1.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aho-corasick 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "semver"
-version = "0.2.0"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "nom 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "strsim"
[[package]]
name = "tar"
-version = "0.3.2"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "filetime 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "filetime 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "term"
-version = "0.2.14"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[dependencies]
advapi32-sys = "0.1"
crates-io = { path = "src/crates-io", version = "0.1" }
-crossbeam = "0.1"
+crossbeam = "0.2"
curl = "0.2"
docopt = "0.6"
env_logger = "0.3"
git2 = "0.3"
git2-curl = "0.3"
glob = "0.2"
-kernel32-sys = "0.1"
+kernel32-sys = "0.2"
libc = "0.2"
libgit2-sys = "0.3"
log = "0.3"
regex = "0.1"
rustc-serialize = "0.3"
semver = "0.2.0"
-tar = "0.3"
-term = "0.2"
+tar = "0.4"
+term = "0.4"
time = "0.1"
toml = "0.1"
url = "0.2"
use cargo::util::important_paths::{find_root_manifest_for_wd};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_no_run: bool,
flag_package: Vec<String>,
flag_jobs: Option<u32>,
use cargo::util::{CliResult, Config};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_package: Vec<String>,
flag_jobs: Option<u32>,
flag_features: Vec<String>,
use cargo::util::{self, CliResult, lev_distance, Config, human, CargoResult};
#[derive(RustcDecodable)]
-struct Flags {
+pub struct Flags {
flag_list: bool,
flag_verbose: bool,
flag_quiet: bool,
use cargo::util::important_paths::{find_root_manifest_for_wd};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_package: Vec<String>,
flag_target: Option<String>,
flag_manifest_path: Option<String>,
use cargo::util::important_paths::{find_root_manifest_for_wd};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_target: Option<String>,
flag_features: Vec<String>,
flag_jobs: Option<u32>,
use cargo::util::important_paths::find_root_manifest_for_wd;
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_manifest_path: Option<String>,
flag_verbose: bool,
flag_quiet: bool,
use cargo::util::important_paths::find_root_manifest_for_wd;
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_manifest_path: Option<String>,
flag_verbose: bool,
flag_quiet: bool,
use cargo::util::{Config, CliResult, CliError, human, ToUrl};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_url: String,
flag_reference: String,
flag_verbose: bool,
use cargo::util::{CliResult, CliError, Config};
#[derive(RustcDecodable)]
-struct Options;
+pub struct Options;
pub const USAGE: &'static str = "
Get some help with a cargo command.
use cargo::util::{CliResult, Config, ToUrl, human};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_jobs: Option<u32>,
flag_features: Vec<String>,
flag_no_default_features: bool,
use cargo::util::important_paths::{find_root_manifest_for_wd};
#[derive(RustcDecodable)]
-struct LocateProjectFlags {
+pub struct LocateProjectFlags {
flag_manifest_path: Option<String>,
}
";
#[derive(RustcEncodable)]
-struct ProjectLocation {
+pub struct ProjectLocation {
root: String
}
use cargo::util::{CliResult, Config, human, ChainError};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_host: Option<String>,
arg_token: Option<String>,
flag_verbose: bool,
use cargo::util::{CliResult, Config};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_verbose: bool,
flag_quiet: bool,
flag_color: Option<String>,
use cargo::util::{CliResult, Config};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
arg_crate: Option<String>,
flag_token: Option<String>,
flag_add: Option<Vec<String>>,
use cargo::util::important_paths::find_root_manifest_for_wd;
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_verbose: bool,
flag_quiet: bool,
flag_color: Option<String>,
use cargo::util::important_paths::{find_root_manifest_for_wd};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_verbose: bool,
flag_quiet: bool,
flag_color: Option<String>,
use cargo::util::important_paths::find_root_manifest_for_wd;
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_host: Option<String>,
flag_token: Option<String>,
flag_manifest_path: Option<String>,
use cargo::sources::{PathSource};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_manifest_path: Option<String>,
flag_color: Option<String>,
}
use cargo::util::important_paths::{find_root_manifest_for_wd};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_bin: Option<String>,
flag_example: Option<String>,
flag_jobs: Option<u32>,
use cargo::util::{CliResult, CliError, Config};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
arg_opts: Option<Vec<String>>,
flag_package: Option<String>,
flag_jobs: Option<u32>,
use cargo::util::important_paths::{find_root_manifest_for_wd};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
arg_opts: Vec<String>,
flag_target: Option<String>,
flag_features: Vec<String>,
use cargo::util::{CliResult, Config};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_host: Option<String>,
flag_verbose: bool,
flag_quiet: bool,
use cargo::util::important_paths::{find_root_manifest_for_wd};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
arg_args: Vec<String>,
flag_features: Vec<String>,
flag_jobs: Option<u32>,
use cargo::util::{CliResult, Config};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_bin: Vec<String>,
flag_root: Option<String>,
flag_verbose: bool,
use cargo::util::important_paths::find_root_manifest_for_wd;
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
flag_package: Vec<String>,
flag_aggressive: bool,
flag_precise: Option<String>,
pub type Error = HashMap<String, String>;
#[derive(RustcDecodable)]
-struct Flags {
+pub struct Flags {
flag_manifest_path: Option<String>,
flag_verbose: bool,
flag_quiet: bool,
use cargo::util::{CliResult, Config};
#[derive(RustcDecodable)]
-struct Options;
+pub struct Options;
pub const USAGE: &'static str = "
Show version information
use cargo::util::{CliResult, Config};
#[derive(RustcDecodable)]
-struct Options {
+pub struct Options {
arg_crate: Option<String>,
flag_token: Option<String>,
flag_vers: Option<String>,
use std::io::prelude::*;
use std::io;
-use term::Attr;
use term::color::{Color, BLACK, RED, GREEN, YELLOW};
-use term::{Terminal, TerminfoTerminal, color};
+use term::{self, Terminal, TerminfoTerminal, color, Attr};
use self::AdequateTerminal::{NoColor, Colored};
use self::Verbosity::{Verbose, Normal, Quiet};
&mut self.err
}
- pub fn say<T: ToString>(&mut self, message: T, color: Color) -> io::Result<()> {
+ pub fn say<T: ToString>(&mut self, message: T, color: Color)
+ -> CargoResult<()> {
match self.verbosity {
Quiet => Ok(()),
_ => self.out().say(message, color)
}
}
- pub fn status<T, U>(&mut self, status: T, message: U) -> io::Result<()>
+ pub fn status<T, U>(&mut self, status: T, message: U) -> CargoResult<()>
where T: fmt::Display, U: fmt::Display
{
match self.verbosity {
}
}
- pub fn verbose<F>(&mut self, mut callback: F) -> io::Result<()>
- where F: FnMut(&mut MultiShell) -> io::Result<()>
+ pub fn verbose<F>(&mut self, mut callback: F) -> CargoResult<()>
+ where F: FnMut(&mut MultiShell) -> CargoResult<()>
{
match self.verbosity {
Verbose => callback(self),
}
}
- pub fn concise<F>(&mut self, mut callback: F) -> io::Result<()>
- where F: FnMut(&mut MultiShell) -> io::Result<()>
+ pub fn concise<F>(&mut self, mut callback: F) -> CargoResult<()>
+ where F: FnMut(&mut MultiShell) -> CargoResult<()>
{
match self.verbosity {
Verbose => Ok(()),
}
}
- pub fn error<T: ToString>(&mut self, message: T) -> io::Result<()> {
+ pub fn error<T: ToString>(&mut self, message: T) -> CargoResult<()> {
self.err().say(message, RED)
}
- pub fn warn<T: ToString>(&mut self, message: T) -> io::Result<()> {
+ pub fn warn<T: ToString>(&mut self, message: T) -> CargoResult<()> {
self.err().say(message, YELLOW)
}
self.config.color_config = color_config;
}
- pub fn say<T: ToString>(&mut self, message: T, color: Color) -> io::Result<()> {
+ pub fn say<T: ToString>(&mut self, message: T, color: Color) -> CargoResult<()> {
try!(self.reset());
if color != BLACK { try!(self.fg(color)); }
try!(write!(self, "{}\n", message.to_string()));
}
pub fn say_status<T, U>(&mut self, status: T, message: U, color: Color)
- -> io::Result<()>
+ -> CargoResult<()>
where T: fmt::Display, U: fmt::Display
{
try!(self.reset());
Ok(())
}
- fn fg(&mut self, color: color::Color) -> io::Result<bool> {
+ fn fg(&mut self, color: color::Color) -> CargoResult<bool> {
let colored = self.colored();
match self.terminal {
- Colored(ref mut c) if colored => c.fg(color),
- _ => Ok(false)
+ Colored(ref mut c) if colored => try!(c.fg(color)),
+ _ => return Ok(false),
}
+ Ok(true)
}
- fn attr(&mut self, attr: Attr) -> io::Result<bool> {
+ fn attr(&mut self, attr: Attr) -> CargoResult<bool> {
let colored = self.colored();
match self.terminal {
- Colored(ref mut c) if colored => c.attr(attr),
- _ => Ok(false)
+ Colored(ref mut c) if colored => try!(c.attr(attr)),
+ _ => return Ok(false)
}
+ Ok(true)
}
fn supports_attr(&self, attr: Attr) -> bool {
}
}
- fn reset(&mut self) -> io::Result<()> {
+ fn reset(&mut self) -> term::Result<()> {
let colored = self.colored();
match self.terminal {
- Colored(ref mut c) if colored => c.reset().map(|_| ()),
- _ => Ok(())
+ Colored(ref mut c) if colored => try!(c.reset()),
+ _ => ()
}
+ Ok(())
}
fn colored(&self) -> bool {
use std::fs::{self, File};
use std::path::{self, Path, PathBuf};
-use tar::Archive;
+use tar::{Archive, Builder};
use flate2::{GzBuilder, Compression};
use flate2::read::GzDecoder;
.write(tmpfile, Compression::Best);
// Put all package files into a compressed archive
- let ar = Archive::new(encoder);
+ let mut ar = Builder::new(encoder);
let root = pkg.root();
for file in try!(src.list_files(pkg)).iter() {
if &**file == dst { continue }
internal(format!("could not archive source file `{}`", relative))
}));
}
- try!(ar.finish());
+ let encoder = try!(ar.into_inner());
+ try!(encoder.finish());
Ok(())
}
use std::process::{Output, ExitStatus};
use std::str;
-use semver;
-use rustc_serialize::json;
-
use curl;
use git2;
+use rustc_serialize::json;
+use semver;
+use term;
use toml;
use url;
url::ParseError,
toml::DecodeError,
ffi::NulError,
+ term::Error,
}
impl<E: CargoError> From<Human<E>> for Box<CargoError> {
impl CargoError for toml::DecodeError {}
impl CargoError for url::ParseError {}
impl CargoError for ffi::NulError {}
+impl CargoError for term::Error {}
// =============================================================================
// Construction helpers
use flate2::write::GzEncoder;
use git2;
use rustc_serialize::hex::ToHex;
-use tar::{Archive, Header};
+use tar::{Builder, Header};
use url::Url;
use support::paths;
let dst = self.archive_dst();
fs::create_dir_all(dst.parent().unwrap()).unwrap();
let f = File::create(&dst).unwrap();
- let a = Archive::new(GzEncoder::new(f, Default));
- self.append(&a, "Cargo.toml", &manifest);
+ let mut a = Builder::new(GzEncoder::new(f, Default));
+ self.append(&mut a, "Cargo.toml", &manifest);
if self.files.is_empty() {
- self.append(&a, "src/lib.rs", "");
+ self.append(&mut a, "src/lib.rs", "");
} else {
for &(ref name, ref contents) in self.files.iter() {
- self.append(&a, name, contents);
+ self.append(&mut a, name, contents);
}
}
- a.finish().unwrap();
}
- fn append<W: Write>(&self, ar: &Archive<W>, file: &str, contents: &str) {
- let mut header = Header::new();
+ fn append<W: Write>(&self, ar: &mut Builder<W>, file: &str, contents: &str) {
+ let mut header = Header::new_ustar();
header.set_size(contents.len() as u64);
header.set_path(format!("{}-{}/{}", self.name, self.vers, file)).unwrap();
header.set_cksum();
- ar.append(&header, &mut contents.as_bytes()).unwrap();
+ ar.append(&header, contents.as_bytes()).unwrap();
}
pub fn archive_dst(&self) -> PathBuf {
use std::env;
use std::fs::{self, File};
use std::io::prelude::*;
-use std::thread;
use tempdir::TempDir;
use support::{project, execs, main_file, basic_bin_manifest};
assert_that(&p.bin("foo"), existing_file());
if cfg!(windows) {
// On windows unlinking immediately after running often fails, so sleep
- thread::sleep_ms(100);
+ ::sleep_ms(100);
}
fs::remove_file(&p.bin("foo")).unwrap();
assert_that(p.cargo("run"),
use std::fs::{self, File};
use std::io::prelude::*;
-use std::thread;
use support::{project, execs};
use support::{COMPILING, RUNNING, DOCTEST, FRESH, DOCUMENTING};
{running} `rustc src[..]lib.rs [..]`
", running = RUNNING, compiling = COMPILING)));
- thread::sleep_ms(1000);
+ ::sleep_ms(1000);
File::create(p.root().join("foo")).unwrap();
File::create(p.root().join("bar")).unwrap();
{fresh} a v0.5.0 ([..])
", fresh = FRESH)));
- thread::sleep_ms(1000);
+ ::sleep_ms(1000);
// random other files do not affect freshness
println!("run baz");
use std::fs::{self, File};
use std::io::prelude::*;
use std::path::Path;
-use std::thread;
use git2;
use support::{git, project, execs, main_file, path2url};
git::add(&repo);
git::commit(&repo);
- thread::sleep_ms(1000);
+ ::sleep_ms(1000);
// By default, not transitive updates
println!("dep1 update");
git::add(&repo);
git::commit(&repo);
- thread::sleep_ms(1000);
+ ::sleep_ms(1000);
let rev = repo.revparse_single("HEAD").unwrap().id();
git::add(&repo);
git::commit(&repo);
- thread::sleep_ms(1000);
+ ::sleep_ms(1000);
// Update the dependency and carry on!
println!("update");
assert_that(project.cargo("update").arg("-v"),
}).unwrap();
foo.root().move_into_the_past().unwrap();
- thread::sleep_ms(1000);
+ ::sleep_ms(1000);
assert_that(foo.cargo("build"),
execs().with_status(0)
use std::fs::{self, File};
use std::io::prelude::*;
-use std::thread;
use support::{project, execs, main_file};
use support::{COMPILING, RUNNING};
//
// We base recompilation off mtime, so sleep for at least a second to ensure
// that this write will change the mtime.
- thread::sleep_ms(1000);
+ ::sleep_ms(1000);
File::create(&p.root().join("baz/src/baz.rs")).unwrap().write_all(br#"
pub fn baz() { println!("hello!"); }
"#).unwrap();
COMPILING, p.url())));
// Make sure an update to bar doesn't trigger baz
- thread::sleep_ms(1000);
+ ::sleep_ms(1000);
File::create(&p.root().join("bar/src/bar.rs")).unwrap().write_all(br#"
extern crate baz;
pub fn bar() { println!("hello!"); baz::baz(); }
use std::fs::{self, File};
use std::io::prelude::*;
-use std::thread;
use support::{project, execs, path2url};
use support::COMPILING;
", compiling = COMPILING, dir = path2url(p.root()))));
assert_that(p.cargo("test"),
execs().with_status(0));
- thread::sleep_ms(1000);
+ ::sleep_ms(1000);
assert_that(&p.bin("foo"), existing_file());
use std::fs::File;
-use std::io::Cursor;
use std::io::prelude::*;
use std::path::Path;
use tar::Archive;
use support::{project, execs, paths, git, path2url};
-use support::{PACKAGING, VERIFYING, COMPILING, ARCHIVING, UPDATING, DOWNLOADING};
-use support::registry::{self, Package};
+use support::{PACKAGING, VERIFYING, COMPILING, ARCHIVING};
use hamcrest::{assert_that, existing_file};
fn setup() {
let mut rdr = GzDecoder::new(f).unwrap();
let mut contents = Vec::new();
rdr.read_to_end(&mut contents).unwrap();
- let ar = Archive::new(Cursor::new(contents));
- for f in ar.files().unwrap() {
+ let mut ar = Archive::new(&contents[..]);
+ for f in ar.entries().unwrap() {
let f = f.unwrap();
let fname = f.header().path_bytes();
let fname = &*fname;
let mut rdr = GzDecoder::new(f).unwrap();
let mut contents = Vec::new();
rdr.read_to_end(&mut contents).unwrap();
- let ar = Archive::new(Cursor::new(contents));
- for f in ar.files().unwrap() {
+ let mut ar = Archive::new(&contents[..]);
+ for f in ar.entries().unwrap() {
let f = f.unwrap();
let fname = f.header().path_bytes();
let fname = &*fname;
use std::io::prelude::*;
use std::fs::{self, File};
-use std::io::{Cursor, SeekFrom};
+use std::io::SeekFrom;
use std::path::PathBuf;
use flate2::read::GzDecoder;
assert_eq!(rdr.header().filename().unwrap(), "foo-0.0.1.crate".as_bytes());
let mut contents = Vec::new();
rdr.read_to_end(&mut contents).unwrap();
- let inner = Cursor::new(contents);
- let ar = Archive::new(inner);
- for file in ar.files().unwrap() {
+ let mut ar = Archive::new(&contents[..]);
+ for file in ar.entries().unwrap() {
let file = file.unwrap();
let fname = file.header().path_bytes();
let fname = &*fname;
use std::fs::File;
use std::io::prelude::*;
use std::str;
-use std::thread;
use support::{project, execs, basic_bin_manifest, basic_lib_manifest};
use support::{COMPILING, RUNNING, DOCTEST};
assert_that(p.cargo("test").arg("-v"),
execs().with_status(0));
- thread::sleep_ms(1000);
+ ::sleep_ms(1000);
File::create(&p.root().join("src/main.rs")).unwrap()
.write_all(b"fn main() { 3; }").unwrap();
use cargo::core::shell::{Shell, ShellConfig};
use cargo::core::shell::ColorConfig::{Auto,Always, Never};
+use cargo::util::CargoResult;
use support::{Tap, execs, shell_writes};
execs().with_stderr(""));
});
-fn colored_output(string: &str, color: color::Color) -> io::Result<String> {
+fn colored_output(string: &str, color: color::Color) -> CargoResult<String> {
let mut term = TerminfoTerminal::new(Vec::new()).unwrap();
try!(term.reset());
try!(term.fg(color));
fn cargo_process() -> cargo::util::ProcessBuilder {
process(&support::cargo_dir().join("cargo"))
}
+
+#[allow(deprecated)] // sleep_ms is now deprecated in favor of sleep()
+fn sleep_ms(ms: u32) {
+ std::thread::sleep_ms(ms);
+}